<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

	<head lang="en">
		<meta charset="UTF-8">
		<title>登录</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta name="format-detection" content="telephone=no">
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp" />

		<link rel="stylesheet" href="/Public/AmazeUI-2.4.2/assets/css/amazeui.css" />
		<link href="/Public/css/dlstyle.css" rel="stylesheet" type="text/css">
		<script src="/Public/AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
	</head>

	<body>

		<div class="login-boxtitle">
			<a href="home.html"><img alt="logo" src="/Public/images/logobig.png" /></a>
		</div>

		<div class="login-banner">
			<div class="login-main">
				<div class="login-banner-bg"><span></span><img src="/Public/images/big.jpg" /></div>
				<div class="login-box">

							<h3 class="title">登录商城</h3>

							<div class="clear"></div>
						
						<div class="login-form">
						  <form>
							   <div class="user-name">
								    <label for="user"><i class="am-icon-user"></i></label>
								    <input type="text"  id="usernickname" placeholder="邮箱/手机/用户名">
                 </div>
                 <div class="user-pass">
								    <label for="password"><i class="am-icon-lock"></i></label>
								    <input type="password" name="" id="password" placeholder="请输入密码">
                 </div>
              </form>
           </div>
            
            <div class="login-links">
                <label for="remember-me"><input id="remember-me" type="checkbox">记住密码</label>
								<a href="#" class="am-fr">忘记密码</a>
								<a href="/Home/Register/register" class="zcnext am-fr am-btn-default">注册</a>
								<br/>
            </div>
								<div class="am-cf">
									<input type="submit" onclick="Login()" id="login-btn" value="登 录" class="am-btn am-btn-primary am-btn-sm">
								</div>
						<div class="partner">		
								<h3>合作账号</h3>
							<div class="am-btn-group">
								<li><a href="#"><i class="am-icon-qq am-icon-sm"></i><span>QQ登录</span></a></li>
								<li><a href="https://api.weibo.com/oauth2/authorize?client_id=361124507&response_type=code&redirect_uri=http%3a%2f%2fwx.faquwen.com%2findex.php%3fbackurl%3dhttp%3a%2f%2fwww.shop.org%2fHome%2fAuth%2findex%3f"><i class="am-icon-weibo am-icon-sm"></i><span>微博登录</span> </a></li>
								<li><a href="#"><i class="am-icon-weixin am-icon-sm"></i><span>微信登录</span> </a></li>
							</div>
						</div>	

				</div>
			</div>
		</div>
		
					<div class="footer ">
						<div class="footer-hd ">
							<p>
								<a href="# ">恒望科技</a>
								<b>|</b>
								<a href="# ">商城首页</a>
								<b>|</b>
								<a href="# ">支付宝</a>
								<b>|</b>
								<a href="# ">物流</a>
							</p>
						</div>
						<div class="footer-bd ">
							<p>
								<a href="# ">关于恒望</a>
								<a href="# ">合作伙伴</a>
								<a href="# ">联系我们</a>
								<a href="# ">网站地图</a>
								<em>© 2015-2025 Hengwang.com 版权所有</em>
							</p>
						</div>
					</div>
				</div>	
	<!---绑定手机窗口----->
		<!--div class="am-modal am-modal-no-btn" tabindex="-1" id="bind-mobile">
  <div class="am-modal-dialog">
    <div class="am-modal-hd">
      <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
    </div>
    
    <div class="am-form-group">
      <label for="doc-ipt-email-1">手机号：</label>
      <input type="email" class="" id="mobile2" placeholder="请输入手机号">
    </div>

    <div class="am-form-group">
      <label for="doc-ipt-pwd-1">手机验证码:</label>
      <input type="text" class="" id="code2" placeholder="请输入手机验证码">
      <a class="am-btn am-btn-danger"  target="_blank">获取验证码</a>
    </div>

    <div class="am-modal-bd" style="width:400px;">
	<a class="am-btn am-btn-danger" onclick=bindMobile() >绑定手机</a>
    </div>
  </div-->

<script>
function getLocalTime(nS) {     
   return new Date(parseInt(nS) * 1000).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");      
}	
function checkLogin(){
	$.get('/Api/Auth/check',null,function(ret){
	if(ret.staus == true && ret.count == '1'){
		$('#login-box').hide();
		$('#login-info-box').show();
		//$('#login-info-box').find('img').attr("src",ret.data.head_img);
		$('#login-info-box').find('#login-nickname').html(ret.data.user_nickname);
	}else if(ret.staus == false && ret.count == '3')
		{
			$('#bind-mobile').modal('open');
		}else{	
			$('#login-info-box').hide();
			$('#login-box').show();
		}
	
	
});	
}
checkLogin();
function loginout(){
	$.get('/Api/Auth/loginout',null,function(ret){
		if(ret.staus == true ){
			window.location.href=window.location.href;
			$('#login-info-box').hide();
			$('#logon-btn').show();	
		}
	});
}
function bindMobile(){
	var mobile =$('#mobile2').val();
	var code = $('#code2').val();
	$.get('/Api/Auth/bindMobile',{mobile2:mobile,code2:code},function(ret){
		if(ret.staus == true ){
			$('#bind-mobile').modal('close');
			window.location.href=window.location.href;
		}
	});	
}
function geturl(name) {
    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
    var r = window.location.search.substr(1).match(reg);
    if (r != null) {
        return unescape(r[2]);
    }
    return null;
}
</script>
			
	</body>

</html>
<script>
function Login(){
	var user = $('#usernickname').val();
	var password = $('#password').val();
	$.get('/Api/Auth/login',{user:user,password:password},function(ret){
		if( ret.staus == true){
			window.location.href="/Home/Index/index";
		}else{
			
			alert("登录失败");
			//window.location.href="/Home/Login/index";
		}
	});
}
</script>